import React from 'react'
import { $pre } from "../../../../http/http";
import "./Group.less"
import { withRouter } from 'react-router-dom'

function Group(props) {
    let { group } = props
    // console.log('getgroup',getgroup);
    return (
        <div className='getgroup'>
            <h1>万人团</h1>
            {group.length == 0 ? <div>暂无数据</div> :
                <ul>{group.map((i) => {
                    return <li key={i.id}
                    onClick={() => {props.history.push(`/detail/${i.id}/2`)}}
                    >
                        <img src={$pre+i.img} alt="" />
                        <h2>商品名称:{i.goodsname}</h2>
                        <div>总数量：{i.count}</div>
                        <div>可买数量：{i.buy_count}</div>
                        <div>每人限买：{i.limit_count}</div>
                        <div>原价：{i.price}</div>
                        <div>现价：{i.market_price}</div>
                    </li>
                })
                }
                </ul>
            }

        </div>
  )
}
export default withRouter(Group)

